package com.wdc.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.wdc.model.domain.User;
import com.wdc.model.request.UserLoginRequest;
import com.wdc.model.request.UserRegisterRequest;
import com.wdc.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author wdc
* @description 针对表【user(用户表)】的数据库操作Service
* @createDate 2024-07-11 15:17:59
*/
public interface UserService extends IService<User> {

    List<User> searchUsersByTags(List<String> tagNameList);

    /**
     * 根据标签搜索用户
     * @param originUser
     * @return
     */
    User getSafetyUser(User originUser);


    /**
     * 更新用户信息
     * @param user
     * @return
     */
    int updateUser(User user, User loginUser);

    /**
     * 获取动迁登录用户的信息
     * @param request
     * @return
     */
    User getLoginUser(HttpServletRequest request);

    /**
     * 是否为管理员
     *
     * @param request
     * @return
     */
     boolean isAdmin(HttpServletRequest request);

    boolean isAdmin(User logigUser);

    /**
     * 用户登录
     * @param userLoginRequest
     * @return
     */
    User userLogin(UserLoginRequest userLoginRequest,HttpServletRequest request);


    /**
     * 匹配用户
     * @param num
     * @param loginUser
     * @return
     */
    List<User> matchUsers(long num, User loginUser);


    Integer userLogout(HttpServletRequest request);

    User userRegister(UserRegisterRequest userRegisterRequest, HttpServletRequest request);

    UserVO getUserById(Long userID, Long loginUserId);
}
